package cn.flyboy.test;

import cn.flyboy.utils.ExcelWriter;
import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;

public class testImportExcel {
    @Test
    public void testExcel() throws Exception {

        ExcelWriter writer = new ExcelWriter();

        writer.write(0, 0, "学号");
        writer.write(0, 1, "姓名");
        writer.write(0, 2, "科目");
        writer.write(0, 3, "班级");
        writer.write(0, 4, "成绩");
        writer.write(1, 0, "1001");
        writer.write(1, 1, "张三");
        writer.write(1, 2, "JAVA");
        writer.write(1, 3, "15-4");
        writer.write(1, 4, "90");

        ByteArrayOutputStream baso = new ByteArrayOutputStream();
        boolean flag = writer.saveToFile(baso);
        System.out.println(flag);

        byte[] array = baso.toByteArray();
        InputStream in = new ByteArrayInputStream(array);
    }
}
